/// 删除好友请求模型
class DeleteFriendRequest {
  final int userId;
  final int friendId;
  final int timestamp;

  DeleteFriendRequest({
    required this.userId,
    required this.friendId,
    int? timestamp,
  }) : timestamp = timestamp ?? DateTime.now().millisecondsSinceEpoch ~/ 1000;

  Map<String, dynamic> toJson() {
    return {
      'user_id': userId,
      'friend_id': friendId,
      'timestamp': timestamp,
    };
  }
}

/// 删除好友响应模型
class DeleteFriendResponse {
  final String status;
  final String message;

  DeleteFriendResponse({
    required this.status,
    required this.message,
  });

  bool get isSuccess => status == 'success';

  factory DeleteFriendResponse.fromJson(Map<String, dynamic> json) {
    return DeleteFriendResponse(
      status: json['status'] ?? 'error',
      message: json['message'] ?? '未知错误',
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'status': status,
      'message': message,
    };
  }
}
